package com.daocheng.dc.book.oss.api;

import com.daocheng.dc.book.oss.config.FeignFormConfig;
import com.daocheng.dc.book.oss.constant.ApiConstants;
import com.daocheng.framework.common.response.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * @ClassName FileFeignApi
 * @author: 稻城
 * @date: 2025/3/26
 * @Version 1.0
 * @description: TODO
 */
@FeignClient(name = ApiConstants.SERVICE_NAME,configuration = FeignFormConfig.class)
public interface FileFeignApi {

    String PREFIX = "/file";

    @PostMapping(value = PREFIX + "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Response<?> uploadFile(@RequestPart(value = "file") MultipartFile file);

}